package com.rzl.expense.expense.service.impl;

import java.util.List;
import com.rzl.expense.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rzl.expense.expense.mapper.EleContractMapper;
import com.rzl.expense.expense.domain.EleContract;
import com.rzl.expense.expense.service.IEleContractService;

/**
 * 电费合同Service业务层处理
 * 
 * @author expense
 * @date 2025-03-06
 */
@Service
public class EleContractServiceImpl implements IEleContractService 
{
    @Autowired
    private EleContractMapper eleContractMapper;

    /**
     * 查询电费合同
     * 
     * @param elecontractId 电费合同主键
     * @return 电费合同
     */
    @Override
    public EleContract selectEleContractByElecontractId(String elecontractId)
    {
        return eleContractMapper.selectEleContractByElecontractId(elecontractId);
    }

    /**
     * 查询电费合同列表
     * 
     * @param eleContract 电费合同
     * @return 电费合同
     */
    @Override
    public List<EleContract> selectEleContractList(EleContract eleContract)
    {
        return eleContractMapper.selectEleContractList(eleContract);
    }

    /**
     * 新增电费合同
     * 
     * @param eleContract 电费合同
     * @return 结果
     */
    @Override
    public int insertEleContract(EleContract eleContract)
    {
        eleContract.setCreateTime(DateUtils.getNowDate());
        return eleContractMapper.insertEleContract(eleContract);
    }

    /**
     * 修改电费合同
     * 
     * @param eleContract 电费合同
     * @return 结果
     */
    @Override
    public int updateEleContract(EleContract eleContract)
    {
        eleContract.setUpdateTime(DateUtils.getNowDate());
        return eleContractMapper.updateEleContract(eleContract);
    }

    /**
     * 批量删除电费合同
     * 
     * @param elecontractIds 需要删除的电费合同主键
     * @return 结果
     */
    @Override
    public int deleteEleContractByElecontractIds(String[] elecontractIds)
    {
        return eleContractMapper.deleteEleContractByElecontractIds(elecontractIds);
    }

    /**
     * 删除电费合同信息
     * 
     * @param elecontractId 电费合同主键
     * @return 结果
     */
    @Override
    public int deleteEleContract(String startDate,String endDate)
    {
        return eleContractMapper.deleteEleContract(startDate,endDate);
    }




    @Override
    public void batchEleContract(List<EleContract> list)
    {

         eleContractMapper.batchEleContract(list);
    }


}
